//
//  PortfilioSubTitleCell.m
//  BaseProject
//
//  Created by 王盼盼 on 2024/12/5.
//  Copyright © 2024 wangpanpan. All rights reserved.
//

#import "PortfilioSubTitleCell.h"

@interface PortfilioSubTitleCell ()

@end

@implementation PortfilioSubTitleCell
- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.textLabel.hidden = true;
        [self.contentView addSubview:self.titleLabel];
    }
    return self;
}
- (void)configCellOfSelected:(BOOL)selected {
    if (selected) {
        self.titleLabel.textColor = rgba(254, 118, 15, 1);
        self.titleLabel.backgroundColor = rgba(255, 242, 233, 1);
    } else {
        self.titleLabel.textColor = rgba(47, 47, 52, 1);
        self.titleLabel.backgroundColor = rgba(241, 242, 244, 1);
    }
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.titleLabel.font = kFontMedium(12);
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.frame = CGRectMake(0, (self.height - 22) * 0.5, self.width, 22);
    self.titleLabel.layer.masksToBounds = YES;
    self.titleLabel.layer.cornerRadius = 11;
}
#pragma mark - lazy
- (UILabel *)titleLabel {
    if (!_titleLabel) {
        UILabel *lab = [[UILabel alloc]init];
        lab.font = kFontMedium(12);
        lab.textAlignment = NSTextAlignmentCenter;
        lab.numberOfLines = 1;
        _titleLabel = lab;
    }
    return _titleLabel;
}
@end
